package net.stogi.unicore.beyond.ui.client.taskeditor.taskoutline;

import net.stogi.unicore.beyond.api.model.OutputDefinition;
import net.stogi.unicore.beyond.api.model.OutputGroup;

import com.google.gwt.event.shared.GwtEvent;

public class OutputDefinitionMovedEvent extends GwtEvent<OutputDefinitionMovedHandler> {

	public static final GwtEvent.Type<OutputDefinitionMovedHandler> TYPE = new GwtEvent.Type<OutputDefinitionMovedHandler>();

	private OutputDefinition outputDefinition;

	private OutputGroup outputGroup;

	public OutputDefinitionMovedEvent(OutputDefinition outputDefinition, OutputGroup outputGroup) {
		this.outputDefinition = outputDefinition;
		this.outputGroup = outputGroup;
	}

	@SuppressWarnings("unused")
	private OutputDefinitionMovedEvent() {}

	@Override
	public Type<OutputDefinitionMovedHandler> getAssociatedType() {
		return TYPE;
	}

	public OutputDefinition getOutputDefinition() {
		return outputDefinition;
	}

	public OutputGroup getOutputGroup() {
		return outputGroup;
	}

	public void setOutputDefinition(OutputDefinition outputDefinition) {
		this.outputDefinition = outputDefinition;
	}

	public void setOutputGroup(OutputGroup outputGroup) {
		this.outputGroup = outputGroup;
	}

	@Override
	protected void dispatch(OutputDefinitionMovedHandler handler) {
		handler.onOutputDefinitionMoved(this);
	}
}
